-
A
Directions
object provides you with optimal directions between different locations, or waypoints. The directions object passes your request to the Mapbox Directions API and returns the requested information to a closure (block) that you provide. A directions object can handle multiple simultaneous requests. ARouteOptions
object specifies criteria for the results, such as intermediate waypoints, a mode of transportation, or the level of detail to be returned.Each result produced by the directions object is stored in a
See moreRoute
object. Depending on theRouteOptions
object you provide, each route may include detailed information suitable for turn-by-turn directions, or it may include only high-level information such as the distance, estimated travel time, and name of each leg of the trip. The waypoints that form the request may be conflated with nearby locations, as appropriate; the resulting waypoints are provided to the closure.Declaration
Swift
-
A
RouteOptions
object is a structure that specifies the criteria for results returned by the Mapbox Directions API.Pass an instance of this class into the
See moreDirections.calculate(_:completionHandler:)
method. -
A
See moreWaypoint
object indicates a location along a route. It may be the route’s origin or destination, or it may be another location that the route visits. A waypoint object indicates the location’s geographic location along with other optional information, such as a name or the user’s direction approaching the waypoint. You create aRouteOptions
object using waypoint objects and also receive waypoint objects in the completion handler of theDirections.calculate(_:completionHandler:)
method.Declaration
Swift